import request from '../utils/request'
// 获取订单结算信息
export const getCheckoutInfo = () => {
  return request({
    url: '/member/order/pre',
    method: 'get'
  })
}
// 添加收货地址
export const inserAddress = data => {
  return request({
    url: '/member/address',
    method: 'post',
    data
  })
}
// 查询收货地址
export const getAddress = () => {
  return request({
    url: '/member/address',
    method: 'get'
  })
}
// 更新收货地址
export const renewAddress = data => {
  return request({
    url: `/member/address/${data.id}`,
    method: 'put',
    data
  })
}
// 删除收货地址
export const deleteAddress = id => {
  return request({
    url: `/member/address/${id}`,
    method: 'delete'
  })
}
// 提交订单
export const orderSubmit = data => {
  return request({
    url: '/member/order',
    method: 'post',
    data
  })
}
// 获取订单信息
export const getOrderInfo = id => {
  return request({
    url: `/member/order/${id}`,
    method: 'get'
  })
}
